package org.ghost.spring.cloud.feign.demo.service;

import org.ghost.spring.cloud.feign.config.GhostFeignConfig;
import org.ghost.spring.cloud.feign.demo.dto.RspDTO;
import org.ghost.spring.cloud.feign.demo.dto.weather.WeatherDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "PROVIDER", configuration = GhostFeignConfig.class)
public interface IHelloService {
    @RequestMapping(value = "/demo/{id}", method = RequestMethod.GET)
    RspDTO get(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/demo", method = RequestMethod.POST)
    RspDTO post(@RequestBody WeatherDTO reqDTO);

    @RequestMapping(value = "/demo/{id}", method = RequestMethod.PUT)
    RspDTO put(@PathVariable String id, @RequestBody WeatherDTO reqDTO);

    @RequestMapping(value = "/demo/{id}", method = RequestMethod.DELETE)
    RspDTO delete(@PathVariable String id);

    @RequestMapping(value = "/demo/test1", method = RequestMethod.GET)
    String test1();

    @RequestMapping(value = "/demo/test2", method = RequestMethod.GET)
    RspDTO test2();

    @RequestMapping(value = "/demo/test3", method = RequestMethod.GET)
    RspDTO test3();

    @RequestMapping(value = "/demo/test4", method = RequestMethod.GET)
    RspDTO test4();
}
